.class public Lcom/htc/android/footprints/view/PictureView;
.super Landroid/view/View;
.source "PictureView.java"

# interfaces
.implements Lcom/htc/android/footprints/view/IPictureView;


# static fields
.field private static final TAG:Ljava/lang/String; = "PictureViewNew"

.field private static bgDrawable:Landroid/graphics/drawable/Drawable;


# instance fields
.field private bHandler:Landroid/os/Handler;

.field private cacheBmp:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

.field private datePaint:Landroid/graphics/Paint;

.field private df:Ljava/text/DateFormat;

.field isCached:Z

.field isCaching:Z

.field private mDefaultPictureSize:I

.field private mFootprint:Lcom/htc/android/footprints/vo/Footprint;

.field private mFormatedDate:Ljava/lang/String;

.field private mPhotoWidth:I

.field private mPostcardHeight:I

.field private mPostcardWidth:I

.field private mRunnable:Ljava/lang/Runnable;

.field private namePaint:Landroid/graphics/Paint;

.field private offsetDegree:I

.field private offsetpPosition:I

.field private paddingLeft:I

.field private paddingPhoto:F

.field private paddingTop:I

.field private paint:Landroid/graphics/Paint;

.field private photoPaint:Landroid/graphics/Paint;

.field private photoReady:Z

.field private photoView:Landroid/graphics/Bitmap;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    const/4 v0, 0x0

    .line 50
    invoke-direct {p0, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V

    .line 32
    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->offsetDegree:I

    .line 33
    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->offsetpPosition:I

    .line 51
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PictureView;->initView()V

    .line 52
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    const/4 v0, 0x0

    .line 55
    invoke-direct {p0, p1, p2}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 32
    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->offsetDegree:I

    .line 33
    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->offsetpPosition:I

    .line 56
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PictureView;->initView()V

    .line 57
    return-void
.end method

.method static synthetic access$000(Lcom/htc/android/footprints/view/PictureView;)Lcom/htc/android/footprints/vo/Footprint;
    .locals 1
    .parameter "x0"

    .prologue
    .line 25
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    return-object v0
.end method

.method static synthetic access$100(Lcom/htc/android/footprints/view/PictureView;)Landroid/graphics/Bitmap;
    .locals 1
    .parameter "x0"

    .prologue
    .line 25
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->photoView:Landroid/graphics/Bitmap;

    return-object v0
.end method

.method static synthetic access$102(Lcom/htc/android/footprints/view/PictureView;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 25
    iput-object p1, p0, Lcom/htc/android/footprints/view/PictureView;->photoView:Landroid/graphics/Bitmap;

    return-object p1
.end method

.method static synthetic access$200(Lcom/htc/android/footprints/view/PictureView;)I
    .locals 1
    .parameter "x0"

    .prologue
    .line 25
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPhotoWidth:I

    return v0
.end method

.method static synthetic access$302(Lcom/htc/android/footprints/view/PictureView;Z)Z
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 25
    iput-boolean p1, p0, Lcom/htc/android/footprints/view/PictureView;->photoReady:Z

    return p1
.end method

.method static synthetic access$402(Lcom/htc/android/footprints/view/PictureView;Ljava/lang/Runnable;)Ljava/lang/Runnable;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 25
    iput-object p1, p0, Lcom/htc/android/footprints/view/PictureView;->mRunnable:Ljava/lang/Runnable;

    return-object p1
.end method

.method private initView()V
    .locals 3

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 60
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0, v1}, Landroid/graphics/Paint;-><init>(I)V

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->namePaint:Landroid/graphics/Paint;

    .line 61
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0, v1}, Landroid/graphics/Paint;-><init>(I)V

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->datePaint:Landroid/graphics/Paint;

    .line 62
    new-instance v0, Landroid/graphics/Paint;

    const/4 v1, 0x3

    invoke-direct {v0, v1}, Landroid/graphics/Paint;-><init>(I)V

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->photoPaint:Landroid/graphics/Paint;

    .line 64
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PictureView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/text/format/DateFormat;->getDateFormat(Landroid/content/Context;)Ljava/text/DateFormat;

    move-result-object v0

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->df:Ljava/text/DateFormat;

    .line 65
    sget-object v0, Lcom/htc/android/footprints/view/PictureView;->bgDrawable:Landroid/graphics/drawable/Drawable;

    if-nez v0, :cond_0

    .line 66
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PictureView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f020008

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    sput-object v0, Lcom/htc/android/footprints/view/PictureView;->bgDrawable:Landroid/graphics/drawable/Drawable;

    .line 70
    :cond_0
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->paint:Landroid/graphics/Paint;

    .line 71
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->paint:Landroid/graphics/Paint;

    invoke-virtual {v0, v2}, Landroid/graphics/Paint;->setFilterBitmap(Z)V

    .line 72
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->paint:Landroid/graphics/Paint;

    invoke-virtual {v0, v2}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    .line 73
    return-void
.end method


# virtual methods
.method public getFootprint()Lcom/htc/android/footprints/vo/Footprint;
    .locals 1

    .prologue
    .line 177
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    return-object v0
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 11
    .parameter "canvas"

    .prologue
    const/4 v4, 0x1

    const/4 v10, 0x0

    const/high16 v5, 0x4080

    const/4 v9, 0x0

    .line 217
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PictureView;->getVisibility()I

    move-result v0

    if-eqz v0, :cond_1

    .line 308
    :cond_0
    :goto_0
    return-void

    .line 220
    :cond_1
    iget-boolean v0, p0, Lcom/htc/android/footprints/view/PictureView;->isCached:Z

    if-eqz v0, :cond_2

    .line 222
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->cacheBmp:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    invoke-virtual {v0}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v0

    iget-object v1, p0, Lcom/htc/android/footprints/view/PictureView;->paint:Landroid/graphics/Paint;

    invoke-virtual {p1, v0, v9, v9, v1}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    goto :goto_0

    .line 228
    :cond_2
    iget-boolean v0, p0, Lcom/htc/android/footprints/view/PictureView;->photoReady:Z

    if-eqz v0, :cond_4

    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->photoView:Landroid/graphics/Bitmap;

    if-eqz v0, :cond_4

    iget-boolean v0, p0, Lcom/htc/android/footprints/view/PictureView;->isCaching:Z

    if-nez v0, :cond_4

    .line 231
    iput-boolean v4, p0, Lcom/htc/android/footprints/view/PictureView;->isCaching:Z

    .line 232
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->cacheBmp:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    if-nez v0, :cond_3

    .line 233
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    int-to-double v0, v0

    const-wide v2, 0x3ff6666666666666L

    mul-double/2addr v0, v2

    double-to-int v0, v0

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardHeight:I

    add-int/lit8 v1, v1, 0x1e

    sget-object v2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    invoke-static {v0, v1, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v7

    .line 235
    .local v7, bm:Landroid/graphics/Bitmap;
    new-instance v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    invoke-direct {v0, v7}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->cacheBmp:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    .line 238
    .end local v7           #bm:Landroid/graphics/Bitmap;
    :cond_3
    new-instance v8, Landroid/graphics/Canvas;

    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->cacheBmp:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    invoke-virtual {v0}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v0

    invoke-direct {v8, v0}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 239
    .local v8, tmpCanvas:Landroid/graphics/Canvas;
    invoke-virtual {v8}, Landroid/graphics/Canvas;->save()I

    .line 240
    const/high16 v0, -0x3ee0

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->paddingTop:I

    neg-int v1, v1

    add-int/lit8 v1, v1, 0x14

    int-to-float v1, v1

    invoke-virtual {v8, v0, v1}, Landroid/graphics/Canvas;->translate(FF)V

    .line 241
    invoke-virtual {p0, v8}, Lcom/htc/android/footprints/view/PictureView;->draw(Landroid/graphics/Canvas;)V

    .line 242
    invoke-virtual {v8}, Landroid/graphics/Canvas;->restore()V

    .line 244
    iput-boolean v10, p0, Lcom/htc/android/footprints/view/PictureView;->isCaching:Z

    .line 245
    iput-boolean v4, p0, Lcom/htc/android/footprints/view/PictureView;->isCached:Z

    .line 246
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->cacheBmp:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    invoke-virtual {v0, p1}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;->draw(Landroid/graphics/Canvas;)V

    goto :goto_0

    .line 253
    .end local v8           #tmpCanvas:Landroid/graphics/Canvas;
    :cond_4
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    .line 254
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->paddingLeft:I

    int-to-float v0, v0

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->paddingTop:I

    int-to-float v1, v1

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->translate(FF)V

    .line 258
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->offsetDegree:I

    if-eqz v0, :cond_5

    .line 259
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->offsetDegree:I

    int-to-float v0, v0

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    div-int/lit8 v1, v1, 0x2

    int-to-float v1, v1

    iget v2, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardHeight:I

    div-int/lit8 v2, v2, 0x2

    int-to-float v2, v2

    invoke-virtual {p1, v0, v1, v2}, Landroid/graphics/Canvas;->rotate(FFF)V

    .line 264
    :cond_5
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->offsetpPosition:I

    if-eqz v0, :cond_6

    .line 265
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->offsetpPosition:I

    int-to-float v0, v0

    invoke-virtual {p1, v0, v9}, Landroid/graphics/Canvas;->translate(FF)V

    .line 268
    :cond_6
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    .line 275
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardHeight:I

    invoke-virtual {p1, v10, v10, v0, v1}, Landroid/graphics/Canvas;->clipRect(IIII)Z

    .line 276
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->paddingPhoto:F

    add-float v1, v0, v5

    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->paddingPhoto:F

    add-float v2, v0, v5

    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPhotoWidth:I

    int-to-float v0, v0

    iget v3, p0, Lcom/htc/android/footprints/view/PictureView;->paddingPhoto:F

    add-float/2addr v0, v3

    sub-float v3, v0, v5

    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPhotoWidth:I

    int-to-float v0, v0

    iget v4, p0, Lcom/htc/android/footprints/view/PictureView;->paddingPhoto:F

    add-float/2addr v0, v4

    sub-float v4, v0, v5

    sget-object v5, Landroid/graphics/Region$Op;->DIFFERENCE:Landroid/graphics/Region$Op;

    move-object v0, p1

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->clipRect(FFFFLandroid/graphics/Region$Op;)Z

    .line 279
    sget-object v0, Lcom/htc/android/footprints/view/PictureView;->bgDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 280
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    .line 282
    iget-boolean v0, p0, Lcom/htc/android/footprints/view/PictureView;->photoReady:Z

    if-eqz v0, :cond_7

    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->photoView:Landroid/graphics/Bitmap;

    if-eqz v0, :cond_7

    .line 283
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    .line 284
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->paddingPhoto:F

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->paddingPhoto:F

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->translate(FF)V

    .line 285
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->photoView:Landroid/graphics/Bitmap;

    iget-object v1, p0, Lcom/htc/android/footprints/view/PictureView;->photoPaint:Landroid/graphics/Paint;

    invoke-virtual {p1, v0, v9, v9, v1}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    .line 286
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    .line 288
    :cond_7
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    .line 289
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->paddingPhoto:F

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->paddingPhoto:F

    iget v2, p0, Lcom/htc/android/footprints/view/PictureView;->mPhotoWidth:I

    int-to-float v2, v2

    add-float/2addr v1, v2

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->translate(FF)V

    .line 290
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v0, v0, Lcom/htc/android/footprints/vo/Footprint;->mName:Ljava/lang/String;

    if-eqz v0, :cond_8

    .line 291
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v1, v0, Lcom/htc/android/footprints/vo/Footprint;->mName:Ljava/lang/String;

    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v0, v0, Lcom/htc/android/footprints/vo/Footprint;->mName:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v0

    const/16 v2, 0x14

    invoke-static {v0, v2}, Ljava/lang/Math;->min(II)I

    move-result v3

    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->namePaint:Landroid/graphics/Paint;

    invoke-virtual {v0}, Landroid/graphics/Paint;->getTextSize()F

    move-result v5

    iget-object v6, p0, Lcom/htc/android/footprints/view/PictureView;->namePaint:Landroid/graphics/Paint;

    move-object v0, p1

    move v2, v10

    move v4, v9

    invoke-virtual/range {v0 .. v6}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;IIFFLandroid/graphics/Paint;)V

    .line 295
    :cond_8
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFormatedDate:Ljava/lang/String;

    if-eqz v0, :cond_9

    .line 296
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFormatedDate:Ljava/lang/String;

    iget-object v1, p0, Lcom/htc/android/footprints/view/PictureView;->namePaint:Landroid/graphics/Paint;

    invoke-virtual {v1}, Landroid/graphics/Paint;->getTextSize()F

    move-result v1

    iget-object v2, p0, Lcom/htc/android/footprints/view/PictureView;->datePaint:Landroid/graphics/Paint;

    invoke-virtual {v2}, Landroid/graphics/Paint;->getTextSize()F

    move-result v2

    add-float/2addr v1, v2

    const/high16 v2, 0x4040

    add-float/2addr v1, v2

    iget-object v2, p0, Lcom/htc/android/footprints/view/PictureView;->datePaint:Landroid/graphics/Paint;

    invoke-virtual {p1, v0, v9, v1, v2}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 299
    :cond_9
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    .line 307
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    goto/16 :goto_0
.end method

.method protected onLayout(ZIIII)V
    .locals 7
    .parameter "changed"
    .parameter "l"
    .parameter "t"
    .parameter "r"
    .parameter "b"

    .prologue
    const/4 v6, 0x0

    const/high16 v5, 0x438c

    const/high16 v4, 0x3f80

    .line 195
    if-eqz p1, :cond_1

    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    if-eqz v0, :cond_0

    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardHeight:I

    if-nez v0, :cond_1

    .line 196
    :cond_0
    sub-int v0, p5, p3

    int-to-double v0, v0

    const-wide v2, 0x3feb333333333333L

    mul-double/2addr v0, v2

    double-to-int v0, v0

    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardHeight:I

    .line 198
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardHeight:I

    int-to-double v0, v0

    const-wide v2, 0x3feb26c9b26c9b27L

    mul-double/2addr v0, v2

    double-to-int v0, v0

    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    .line 199
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->namePaint:Landroid/graphics/Paint;

    const/high16 v1, 0x41a0

    iget v2, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    int-to-float v2, v2

    div-float/2addr v2, v5

    mul-float/2addr v1, v2

    add-float/2addr v1, v4

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setTextSize(F)V

    .line 200
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->datePaint:Landroid/graphics/Paint;

    const/high16 v1, 0x4180

    iget v2, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    int-to-float v2, v2

    div-float/2addr v2, v5

    mul-float/2addr v1, v2

    add-float/2addr v1, v4

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setTextSize(F)V

    .line 201
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    int-to-double v0, v0

    const-wide v2, 0x3feb851eb851eb85L

    mul-double/2addr v0, v2

    double-to-int v0, v0

    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPhotoWidth:I

    .line 202
    sget-object v0, Lcom/htc/android/footprints/view/PictureView;->bgDrawable:Landroid/graphics/drawable/Drawable;

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    iget v2, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardHeight:I

    invoke-virtual {v0, v6, v6, v1, v2}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 204
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->mPhotoWidth:I

    sub-int/2addr v0, v1

    int-to-float v0, v0

    const/high16 v1, 0x3f00

    mul-float/2addr v0, v1

    sub-float/2addr v0, v4

    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->paddingPhoto:F

    .line 206
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PictureView;->getHeight()I

    move-result v0

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardHeight:I

    sub-int/2addr v0, v1

    div-int/lit8 v0, v0, 0x2

    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->paddingTop:I

    .line 207
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PictureView;->getWidth()I

    move-result v0

    iget v1, p0, Lcom/htc/android/footprints/view/PictureView;->mPostcardWidth:I

    sub-int/2addr v0, v1

    div-int/lit8 v0, v0, 0x2

    iput v0, p0, Lcom/htc/android/footprints/view/PictureView;->paddingLeft:I

    .line 210
    :cond_1
    return-void
.end method

.method protected onMeasure(II)V
    .locals 11
    .parameter "widthMeasureSpec"
    .parameter "heightMeasureSpec"

    .prologue
    const/high16 v10, 0x4000

    .line 79
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v4

    .line 80
    .local v4, widthMode:I
    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v1

    .line 81
    .local v1, heightMode:I
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v5

    .line 82
    .local v5, widthSize:I
    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v2

    .line 89
    .local v2, heightSize:I
    if-ne v1, v10, :cond_0

    .line 91
    move v0, v2

    .line 100
    .local v0, height:I
    :goto_0
    if-ne v4, v10, :cond_1

    .line 102
    move v3, v5

    .line 109
    .local v3, width:I
    :goto_1
    invoke-virtual {p0, v3, v0}, Lcom/htc/android/footprints/view/PictureView;->setMeasuredDimension(II)V

    .line 112
    return-void

    .line 97
    .end local v0           #height:I
    .end local v3           #width:I
    :cond_0
    int-to-double v6, v2

    const-wide v8, 0x3fe999999999999aL

    mul-double/2addr v6, v8

    double-to-int v0, v6

    .restart local v0       #height:I
    goto :goto_0

    .line 104
    :cond_1
    int-to-double v6, v0

    const-wide v8, 0x3feb26c9b26c9b27L

    mul-double/2addr v6, v8

    double-to-int v3, v6

    .restart local v3       #width:I
    goto :goto_1
.end method

.method public reset()V
    .locals 2

    .prologue
    .line 181
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mRunnable:Ljava/lang/Runnable;

    if-eqz v0, :cond_0

    .line 182
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->bHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/htc/android/footprints/view/PictureView;->mRunnable:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    .line 183
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mRunnable:Ljava/lang/Runnable;

    .line 191
    :cond_0
    return-void
.end method

.method public setDefaultPictureSize(I)V
    .locals 0
    .parameter "defaultPictureSize"

    .prologue
    .line 318
    iput p1, p0, Lcom/htc/android/footprints/view/PictureView;->mDefaultPictureSize:I

    .line 319
    return-void
.end method

.method public setFootprint(Lcom/htc/android/footprints/vo/Footprint;II)V
    .locals 10
    .parameter "f"
    .parameter "degree"
    .parameter "position"

    .prologue
    const/4 v9, 0x1

    const/4 v4, 0x0

    .line 118
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->cacheBmp:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    if-eqz v0, :cond_0

    .line 119
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->cacheBmp:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    invoke-virtual {v0}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v0

    invoke-virtual {v0, v4}, Landroid/graphics/Bitmap;->eraseColor(I)V

    .line 120
    iput-boolean v4, p0, Lcom/htc/android/footprints/view/PictureView;->isCached:Z

    .line 123
    :cond_0
    iput p2, p0, Lcom/htc/android/footprints/view/PictureView;->offsetDegree:I

    .line 124
    iput p3, p0, Lcom/htc/android/footprints/view/PictureView;->offsetpPosition:I

    .line 126
    iput-object p1, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    .line 127
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->df:Ljava/text/DateFormat;

    new-instance v1, Ljava/util/Date;

    iget-wide v2, p1, Lcom/htc/android/footprints/vo/Footprint;->mCreateTime:J

    invoke-direct {v1, v2, v3}, Ljava/util/Date;-><init>(J)V

    invoke-virtual {v0, v1}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFormatedDate:Ljava/lang/String;

    .line 129
    iput-boolean v4, p0, Lcom/htc/android/footprints/view/PictureView;->photoReady:Z

    .line 132
    iget v0, p0, Lcom/htc/android/footprints/view/PictureView;->mPhotoWidth:I

    if-lez v0, :cond_1

    .line 133
    new-instance v0, Lcom/htc/android/footprints/view/PictureView$1;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/view/PictureView$1;-><init>(Lcom/htc/android/footprints/view/PictureView;)V

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mRunnable:Ljava/lang/Runnable;

    .line 153
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->bHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/htc/android/footprints/view/PictureView;->mRunnable:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 172
    :goto_0
    return-void

    .line 156
    :cond_1
    iget-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v1, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v1, v1, Lcom/htc/android/footprints/vo/Footprint;->mPicPath:Ljava/lang/String;

    if-nez v1, :cond_2

    const-string v1, ""

    :goto_1
    iput-object v1, v0, Lcom/htc/android/footprints/vo/Footprint;->mPicPath:Ljava/lang/String;

    .line 159
    :try_start_0
    invoke-static {}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->getInstance()Lcom/htc/android/footprints/utils/camera/FootprintImageManager;

    move-result-object v0

    iget-object v1, p0, Lcom/htc/android/footprints/view/PictureView;->photoView:Landroid/graphics/Bitmap;

    new-instance v2, Ljava/io/File;

    iget-object v3, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v3, v3, Lcom/htc/android/footprints/vo/Footprint;->mPicPath:Ljava/lang/String;

    invoke-direct {v2, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PictureView;->getContext()Landroid/content/Context;

    move-result-object v3

    iget v4, p0, Lcom/htc/android/footprints/view/PictureView;->mDefaultPictureSize:I

    iget v5, p0, Lcom/htc/android/footprints/view/PictureView;->mDefaultPictureSize:I

    const/4 v6, 0x2

    const/4 v7, 0x1

    invoke-virtual/range {v0 .. v7}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->getScaledImage(Landroid/graphics/Bitmap;Ljava/io/File;Landroid/content/Context;IIIZ)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->photoView:Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_0

    .line 168
    :goto_2
    iput-boolean v9, p0, Lcom/htc/android/footprints/view/PictureView;->photoReady:Z

    goto :goto_0

    .line 156
    :cond_2
    iget-object v1, p0, Lcom/htc/android/footprints/view/PictureView;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v1, v1, Lcom/htc/android/footprints/vo/Footprint;->mPicPath:Ljava/lang/String;

    goto :goto_1

    .line 163
    :catch_0
    move-exception v0

    move-object v8, v0

    .line 164
    .local v8, e:Ljava/lang/OutOfMemoryError;
    const-string v0, "PictureViewNew"

    const-string v1, "this bitmap will cause OutOfMemory, so skip it"

    invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 165
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PictureView;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0200fe

    invoke-static {v0, v1}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/htc/android/footprints/view/PictureView;->photoView:Landroid/graphics/Bitmap;

    goto :goto_2
.end method

.method public setHandler(Landroid/os/Handler;)V
    .locals 0
    .parameter "handler"

    .prologue
    .line 312
    iput-object p1, p0, Lcom/htc/android/footprints/view/PictureView;->bHandler:Landroid/os/Handler;

    .line 314
    return-void
.end method
